#!/bin/bash
jarFullName=$1
jarName=${jarFullName%.*}
#pid=$(ps -ef | grep -v 'grep' | grep ${jarName} | awk '{print $2}')  
pid=`ps -ef | grep "$jarName" | grep -v "$0" | grep -v "grep" | awk '{print $2}'`
echo 进程ID：${pid}

for id in $pid
do
kill -9 $id
echo "killed $id"
done

echo "done!"